package com.yaozheng.vocationaltraining.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yaozheng.vocationaltraining.R;
import com.yaozheng.vocationaltraining.widget.LastLearnProgressView;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * 最后学习记录
 */
@EViewGroup(R.layout.view_last_learn_text_progress)
public class LastLearnStatusProgressView extends LinearLayout {
    @ViewById
    LastLearnProgressView lastLearnProgressView;
    @ViewById
    TextView paperStatusBut, paperStatusTypeExplanationText;
    @ViewById
    ImageView paperStatusImage;

    double progress;

    public LastLearnStatusProgressView(Context context) {
        super(context);
    }

    public LastLearnStatusProgressView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * 设置进度
     *
     * @param progress
     */
    public void setProgress(float progress) {
        this.progress = progress;
        paperStatusBut.setText(String.valueOf(progress));
        lastLearnProgressView.setCurrProgress(progress);
    }

    public void showImage() {
        paperStatusImage.setVisibility(View.VISIBLE);
        paperStatusTypeExplanationText.setVisibility(View.GONE);
        paperStatusBut.setVisibility(GONE);
    }
}
